From: Joseph Marrero Corchado Date: Mon, 29 Jun 2026 19:22:19 +0000 (-0400) Subject: tests: Fix "remote:branch" test to use ostree_parse_refspec X-Git-Tag: archive/raspbian/2026.2-1+rpi1^2~9^2^2~1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1b705ff3fca33bf221da0e2b991dfc4b017bb05c;p=ostree.git tests: Fix "remote:branch" test to use ostree_parse_refspec ostree_validate_rev() validates bare ref names and does not accept the "remote:ref" refspec syntax — the colon is not part of the OSTREE_REF_REGEXP regex. The "remote:branch" form is a refspec, which is parsed by ostree_parse_refspec(). Replace the incorrect ostree_validate_rev() call with ostree_parse_refspec() and verify the parsed remote and ref components, preserving the original test intent. Fixes: ac10a27d ("pull: Fix GLib assertion crash on invalid UTF-8 ref names") --- diff --git a/tests/test-validate-utf8.c b/tests/test-validate-utf8.c index 4aa07cfc..9f84e6bf 100644 --- a/tests/test-validate-utf8.c +++ b/tests/test-validate-utf8.c @@ -42,9 +42,17 @@ test_valid_utf8_refs (void) g_assert_true (ostree_validate_rev ("my.branch_name", &error)); g_assert_no_error (error); - /* Valid ref with remote */ - g_assert_true (ostree_validate_rev ("remote:branch", &error)); - g_assert_no_error (error); + /* Valid refspec with remote: "remote:branch" is a refspec, not a bare ref. + * ostree_validate_rev() only validates bare ref names; use + * ostree_parse_refspec() for the "remote:ref" form. */ + { + g_autofree char *remote = NULL; + g_autofree char *ref = NULL; + g_assert_true (ostree_parse_refspec ("remote:branch", &remote, &ref, &error)); + g_assert_no_error (error); + g_assert_cmpstr (remote, ==, "remote"); + g_assert_cmpstr (ref, ==, "branch"); + } /* Valid ref with slashes */ g_assert_true (ostree_validate_rev ("path/to/branch", &error));